home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / Amiga_Mail_Vol1 / Trackdisk / AmigaFloppy < prev    next >
Encoding:
Text File  |  1999-10-27  |  5.4 KB  |  134 lines

  1. (c)  Copyright 1989-1999 Amiga, Inc.   All rights reserved.
  2. The information contained herein is subject to change without notice, and 
  3. is provided "as is" without warranty of any kind, either expressed or implied.  
  4. The entire risk as to the use of this information is assumed by the user.
  5.  
  6.  
  7.  
  8.                           Amiga Floppy Drives
  9.  
  10.                            by Bryce Nesbitt
  11.  
  12.  
  13. Some Amiga products that make direct use of the floppy disk drive hardware 
  14. do not work correctly.  As a general rule, using the trackdisk.device is 
  15. the best way to insure compatability.  But if you need to use the drive 
  16. hardware at a lower level, here are some pointers for correct usage.  
  17.  
  18.  
  19. Hardware 
  20.  
  21. Hardware vendors that make floppy drives for the Amiga (or products
  22. that interact with the floppy drives) should follow these guidelines:
  23.  
  24. 1> The disk drive light should not flash on and off during
  25.    access.  The Amiga drive activity light reflects the state of the
  26.    motor.  Typically the LED signal is driven by IN_USE (pin 4).
  27.  
  28. 2> Second drives for the A2000 must take MOTOR_ON from pin 6
  29.    (normally DRIVE_SELECT_3).  Most drives have a jumper block 
  30.    that allows DRIVE_SELECT_3 to control the motor and, in turn, the
  31.    activity light.  The current twisted ribbon cable used on the 
  32.    A2000 also connects the motor signal to IN_USE (pin 4).
  33.  
  34.    To convert an A2000 drive zero to drive one requires changing
  35.    two jumpers.  The drive must respond to DRIVE_SELECT_1 (instead
  36.    of DRIVE_SELECT_0) and it must take it's motor from DRIVE_SELECT_3
  37.    (instead of MOTOR_ON).
  38.  
  39. 3> For compatibility with future systems, disk drives MUST
  40.    refuse to step past track zero.  That is, if the head is already
  41.    at zero and an outward step is received, it should not move the
  42.    head.  The drive must still reset it's DISKCHANGE latch, however.
  43.  
  44. 4> The critical specifications for Amiga 90mm (3.5") drives are:
  45.    3ms track-to-track, 15ms settling time,  >80% radial alignment
  46.    using a Dysan Alignment disk, 500ms motor spinup and 800ms maximum
  47.    power on delay.
  48.  
  49.  
  50.  
  51. Software 
  52.  
  53. This section of the article is for those of you who write custom
  54. boot-loaders for Amiga game software.  Because of defective loaders, 
  55. there are many Amiga owners unable to load certain games.  This will 
  56. lead some of these consumers to never again buy a program from that 
  57. product line.  Here are some tips to help you avoid problems with
  58. custom boot-loaders.
  59.  
  60.  
  61. 1> Don't make bad assumptions.  For example, if you depend on the
  62.    motor being on, turn it on before use.  Don't assume that your
  63.    boot code will be entered with the disk drive or system in any
  64.    known state.
  65.  
  66.  
  67. 2> Never use a busy-wait loop like this for timing:
  68.  
  69.         move.w    #$1000,D0
  70.    busy_wait    dbra        d0,busy_wait
  71.  
  72.    This fails to produce accurate timing under a large number of
  73.    circumstances.  The speed of the above loop depends on what CPU
  74.    is installed in the system, what video mode is selected, what 
  75.    type of memory the program is in, the position of the vertical
  76.    blank at run time, what the blitter is doing, what interrupts are 
  77.    enabled and many other factors.  Instead of a busy-wait loop, use
  78.    the 8520 chip for timing as shown in the Amiga Mail article,
  79.    "How to Waste Time".
  80.  
  81. 3> The STEP line must be used as a low-going pulse.  The
  82.    direction must be set up first, with a separate write to the
  83.    register.  A typical use would be:
  84.  
  85.         or.b   #%00000010,$bfd100    ;Set up direction
  86.         and.b  #%11111110,$bfd100    ;Pulse low
  87.         nop                ;Wait a bit
  88.         nop                ; "   "  "
  89.         or.b   #%00000001,$bfd100    ;Set it high again
  90.         ;-- now wait 3 milliseconds for the head to
  91.         ;-- get to the next track
  92.  
  93.    We specify that our drives must get to the next track within 3
  94.    milliseconds.  Some drives will step considerably faster.  Others
  95.    will fail at or before 2.8 milliseconds.  When the direction of
  96.    step is changed, the settling time must also be added - a total
  97.    minimum delay of 18 milliseconds.
  98.  
  99.    Note that the TRACK ZERO sensor will not be valid until the head
  100.    actually reaches the track.
  101.  
  102.  
  103. 4> When turning on the motor, wait for the READY signal to go low
  104.    before reading or writing.  Steps are okay before then.  Note that
  105.    READY is only valid when the motor signal is ON.
  106.  
  107.  
  108. 5> To determine if a disk is in the drive, look at the DISKCHANGE
  109.    signal.  If it is low, the disk has been removed (and possibly
  110.    inserted again) since the last check.  Step the head to reset the
  111.    latch and examine the current state.
  112.  
  113.  
  114. 6> Some code uses an extra track or two for storage for copy
  115.    protection.  We do not guarantee that our drives will have more
  116.    than the normal 80 tracks.  We do guarantee however that using three    
  117.    extra tracks will fail.
  118.  
  119.  
  120. 7> After a disk write DMA has finished, a delay of 1.2 milliseconds 
  121.    is required before any other operations (drive select, step, head 
  122.    change, etc.).  The type of disk drives we use  have a gap between 
  123.    the erase head and the read-write head.  The disk drive keeps the 
  124.    erase head enabled after the end of write gate to compensate for 
  125.    the gap.  Failure to wait out the delay may result in writing over 
  126.    innocent data on other tracks or sides.
  127.  
  128.  
  129. The ultimate source for information on drive timing comes from the 
  130. manufacturer's specifications.  This article simply highlights the most 
  131. misused points.  Try to use the trackdisk.device software to avoid 
  132. hardware dependencies but if you need more direct control of floppy 
  133. hardware, follow the guidlines given here.
  134.